import React, { Component } from 'react'

export default class componentName extends Component {
  state = {user:{}}
  componentWillMount(){
    let usersStr = localStorage.getItem('users');
    let users = usersStr?JSON.parse(usersStr):[];
    let user = users.find(user=>user.id == this.props.match.params.id);
    this.setState({user});
  }
  render() {
    return (
      <div>
        ID:{this.state.user.id} <br/>
        USERNAME:{this.state.user.username}
      </div>
    )
  }
}
